﻿<html>
<head>
<style>
*{margin:0; padding:0}
.question{border:3px #EEE solid;border-radius:8px; padding:10px;}
.q-item{color:#36A120; font-weight:bold; padding:5px 0; width:100%; background:#FCFCF2}
.a-item{width:250px; float:left;padding-bottom:5px}
.ans{padding-left:5px}
</style>

</head>
<body>
<div style="width:600px">
Chọn thể loại:
	<form name="cateForm" method="POST" action="?act=quiz-list"> 
	<select name='cate_id' onchange="document.cateForm.submit()">
		<?php
		foreach ($cates as $key=>$value) {
			$selected = ($value['id']==$cateId?'selected="selected"':'');
			echo '<option value="'.$value['id'].'" '.$selected.'>'.$value['name'].'</option>';
		}
		?>
	</select>
	</form>
	<br />
Danh sách đề thuộc thể loại <?php echo $cate['name']; ?>:<br />
<?php 
for($i=0; $i<$numberTest; $i++){
	echo '<a href="?act=quiz-list&cate_id='.$cate['id'].'&test_id='.$i.'">Mã đề '.$i.'</a> ;';
}
?>

<?php 
foreach ( $res as $row ) {
	echo '<div class="question">
		<p style="text-align:right"><a href="?act=quiz-edit&id='.$row['id'].'">Edit</a></p>
		<div class="q-item">'.strip_tags($row['content'], '<b><u><i><span><p>').'</div>';
	foreach ($row['aryChoice'] as $key=>$choice) {
		$checked = ($key==$row['answer']?'checked="checked"':'');
		echo '<p class="a-item">'.$aryAnsItem[$key].'. <input type="radio" '.$checked.' disabled="disabled"/><span class="ans">'.strip_tags(htmlspecialchars_decode($choice, ENT_QUOTES), '<b><u><i><span><p>').'</span></p>';
	}
	echo '<br style="clear:both" />
	</div>';
}
?>

</div>
</body>
</html>